#!/usr/bin/env sh

export PATH=$PATH:./Tools/

rm -rf Sources/Clients/* Sources/Protos/*

Tools/protoc \
--proto_path=Dependency/protobuf/common \
--plugin=Tools/protoc-gen-grpc-swift \
--grpc-swift_opt=Visibility=Public \
--grpc-swift_opt=Server=false \
--grpc-swift_opt=FileNaming=DropPath \
--grpc-swift_out=Sources/Clients \
--swift_opt=Visibility=Public \
--swift_out=Sources/Protos \
-I Dependency/protobuf/common \
Dependency/protobuf/common/*.proto

Tools/protoc \
--proto_path=Dependency/protobuf/gateway \
--plugin=Tools/protoc-gen-grpc-swift \
--grpc-swift_opt=Visibility=Public \
--grpc-swift_opt=Server=false \
--grpc-swift_opt=FileNaming=DropPath \
--grpc-swift_out=Sources/Clients \
--swift_opt=Visibility=Public \
--swift_out=Sources/Protos \
-I Dependency/protobuf/common \
Dependency/protobuf/gateway/*.proto

Tools/protoc \
--proto_path=Dependency/protobuf/googleapis/google/rpc/ \
--plugin=Tools/protoc-gen-grpc-swift \
--grpc-swift_opt=Visibility=Public \
--grpc-swift_opt=Server=false \
--grpc-swift_opt=FileNaming=DropPath \
--grpc-swift_out=Sources/Clients \
--swift_opt=Visibility=Public \
--swift_out=Sources/Protos \
-I Dependency/protobuf/protobuf/src/ \
Dependency/protobuf/googleapis/google/rpc/status.proto

